//
//  SYDwithdrawView.m
//  PinGJByOwnerSide
//
//  Created by lantaiyuan on 2017/8/8.
//  Copyright © 2017年 lantaiyuan. All rights reserved.
//

#import "SYDwithdrawView.h"

@interface SYDwithdrawView()

@property (weak, nonatomic) IBOutlet UIView *closeView;

@end
@implementation SYDwithdrawView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self = [[NSBundle mainBundle]loadNibNamed:NSStringFromClass([SYDwithdrawView class]) owner:nil options:nil].lastObject;
        self.frame = frame;
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self drawBorderWithCornerRadius:5];
    
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.closeView.bounds byRoundingCorners:UIRectCornerBottomRight | UIRectCornerBottomLeft cornerRadii:CGSizeMake(15,15          )];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    
    maskLayer.frame = self.closeView.bounds;
    
    maskLayer.path = maskPath.CGPath;
    
    self.closeView.layer.mask = maskLayer;
    
    WEAKSELF
    [self.closeView jk_addTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        if (weakSelf.block) {
            weakSelf.block();
        }
    }];
}


@end
